﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CanDoo.Core;
using CanDoo.Data;
using CanDoo.Contracts;
using CanDoo.Oil.Core.Models;
using CanDoo.Oil.Core.DTOs;
using CanDoo.Core.Data;

namespace CanDoo.Oil.Core.Contracts
{
    /// <summary>
    /// 业务契约——采购单
    /// </summary>
    public interface IInOrderContract : IServiceBaseCore<InOrder>, IServiceBase<InOrder>
    {
        /// <summary>
        /// 生成新单据号
        /// </summary>
        /// <returns></returns>
        string GetNewCode();

        /// <summary>
        /// 商品采购入库或采购退货时更新采购单的入库数量
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        OperationResult UpdateNum(long entityId);

        ///// <summary>
        ///// 商品入库时更新数量
        ///// </summary>
        ///// <param name="inOrder"></param>
        ///// <param name="inStoreDetails"></param>
        ///// <returns></returns>
        //OperationResult InToStore(InOrder inOrder, IEnumerable<InStoreDetail> inStoreDetails);

        ///// <summary>
        ///// 商品出库时更新数量
        ///// </summary>
        ///// <param name="inOrder"></param>
        ///// <param name="inStoreDetails"></param>
        ///// <returns></returns>

        //OperationResult OutFromStore(InOrder inOrder, IEnumerable<InStoreDetail> inStoreDetails);

        /// <summary>ProductItem
        /// 实体转换为Dto
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        ProductItem EntityChange(InOrderDetail m);
    }
}

